#pragma once

#include "FoGGEDef.h"

#include "PredefinedModuleID.h"

#include "DataAccesser.h"

#include "BulletinBoard.h"

namespace _FOGGE_
{

	class _FoGGEExport aEngineModule
		:protected _GDB_::DataAccesser
	{
		friend class aGGE;
	public:
		aEngineModule(type_moduleid moduleID,LPCTSTR moduleName);
		virtual ~aEngineModule(void);

		virtual void Update(float elapsedtime)=0;

		virtual bool SystemInitialize()=0;
		virtual void SystemFinalize()=0;
		virtual bool Initialize()=0;
		virtual void Finalize()=0;

		static void InitializeModuleNameIDMap();

		static LPCTSTR GetModuleName(eEngineModuleID id);
		static type_moduleid GetModuleID(foString &name);
		static type_moduleid GetModuleID(LPCTSTR name);

		LPCTSTR GetMyName();
		type_moduleid GetMyID();

		


	protected:

		virtual void PreUpdate(float elapsedtime){}
		virtual void PostUpdate(float elapsedtime){}
		

		bool m_bIsInitialized;
		
		
				
	private:

		//this is class varible
		
		static std::vector<foString> g_ModuleIDtoModuleName;
		static HashMap<foString,type_moduleid> g_ModuleNametoModuleID;

		
		type_moduleid m_uiMyID;
		foString m_strMyName;

	};
}
#include "aEngineModule.inl"